package org.example;

import org.example.service.ProductService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

@Configuration
@ComponentScan
@EnableAspectJAutoProxy //开启AOP注解支持
public class App 
{
    public static void main( String[] args )
    {
        ApplicationContext ac = new AnnotationConfigApplicationContext(App.class);
        ProductService ps = ac.getBean(ProductService.class);
        ps.delete(100);
        ps.add("商品1", 100);
        String r=ps.findinfo(1000);
        System.out.println(r);
    }
}
